Outline

  1. PART I: Understanding the Model Context Protocol (MCP)
  2. PART II: MCP Integration in Camel

PART I: What is MCP, exactly?

Brief History of Function Calling (1/2)

  • Pre-2023 - When LLMs Lacked Environmental Awareness:
    • Tool usage implemented via prompt engineering
    • Support provided at framework level (e.g., LangChain, Camel agents)
    • No native capabilities; relied on parsing unstructured model outputs
  • June 2023 – OpenAI Launches Native Function Calling:
    • Introduced in GPT-4 and GPT-3.5-turbo
    • Utilized structured JSON outputs to call tools and pass arguments
    • Enabled significantly more reliable and scalable tool integration

Brief History of Function Calling (2/2)

  • Nov 2024 – Anthropic Proposes MCP (Model Context Protocol):
    • Formalizes tool interaction using JSON-RPC 2.0 standard
    • Standardizes communication between AI systems and external tools/resources
  • 2025 – Industry-Wide Adoption:
    • OpenAI, DeepMind, and other major players adopt MCP
    • Function calling becomes a core capability for advanced agentic AI systems

Why MCP?

The power of standardization:

How Does MCP Work?

  • MCP Hosts: Claude Desktop App, Camel agents, and other deployment environments
  • MCP Clients: Internal protocol engines that handle sending/receiving JSON-RPC messages
  • MCP Servers: Programs that process incoming messages from clients and return structured responses

MCP Ecosystem

MCP is gradually becoming a standard. Here are some useful MCP repositories:

PART II: Camel’s Integration Efforts with MCP

Camel’s Integration with MCP

In this section, we’ll explore how Camel is integrating with the Model Context Protocol to create a more powerful and flexible agent framework. Here’s what we’ll cover:

  1. Agent using MCP tools
  2. Export Camel existing tools as MCP servers
  3. MCP search toolkits/ MCP search agents
  4. Export Camel agents as MCP servers
  5. Future plans

Let’s dive into each of these areas to understand how Camel is embracing the MCP ecosystem.

Hands-on with Camel Agents and Tools

from camel.toolkits import FunctionTool

def my_weird_add(a: int, b: int) -> int:
    r"""Adds two numbers and includes a constant offset.
    Args:
        a (int): The first number to be added.
        b (int): The second number to be added.
    Returns:
        integer: The sum of the two numbers plus 7.
    """
    return a + b + 7

agent = ChatAgent(
    tools=[FunctionTool(my_weird_add)]
)

response = agent.step("What is 15+15")
print(response.msgs[0].content)
The result of 15 + 15, using a special calculation method, is 37.

Hands-on with Camel Agents using MCP Servers (1/2)

Here, we will use Time MCP Server as an example.

First, we need to provide config file for the agent, in this case:

{
  "mcpServers": {
    "time": {
      "command": "uvx",
      "args": ["mcp-server-time", "--local-timezone=Asia/Riyadh"]
    }
  }
}

Hands-on with Camel Agents and MCP Tools (2/2)

import asyncio
from camel.toolkits.mcp_toolkit import MCPToolkit, MCPClient

async def run_time_example():
    # Initialize the MCPToolkit with your configuration file
    mcp_toolkit = MCPToolkit(config_path="config/time.json")
    # Connect to all configured MCP servers
    await mcp_toolkit.connect()
    camel_agent = ChatAgent(
        model=model,
        tools=[*mcp_toolkit.get_tools()],
    )
    response = await camel_agent.astep("What time is it now?")
    print(response.msgs[0].content)
    print(response.info['tool_calls'])
    # Disconnect from all servers
    await mcp_toolkit.disconnect()
await run_time_example()
The current local time in Riyadh is 15:57 (3:57 PM).
[ToolCallingRecord(tool_name='get_current_time', args={'timezone': 'Asia/Riyadh'}, result='{\n  "timezone": "Asia/Riyadh",\n  "datetime": "2025-05-01T15:57:59+03:00",\n  "is_dst": false\n}', tool_call_id='toolu_01Gwdy3Ppzf2z42t6YL7n7cE')]

Creating an MCP Server from a Toolkit

# arxiv_toolkit_server.py
import argparse
import sys
from camel.toolkits import ArxivToolkit

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Run Arxiv Toolkit in MCP server mode.",
        usage=f"python {sys.argv[0]} [--mode MODE]",
    )
    parser.add_argument(
        "--mode",
        choices=["stdio", "sse"],
        default="stdio",
        help="MCP server mode (default: 'stdio')",
    )
    parser.add_argument(
        "--timeout",
        type=float,
        default=None,
        help="Timeout for the MCP server (default: None)",
    )
    args = parser.parse_args()
    toolkit = ArxivToolkit(timeout=args.timeout)
    # Run the toolkit as an MCP server
    toolkit.mcp.run(args.mode)

MCP Search Toolkits (PR 2278)

search_toolkit = PulseMCPSearchToolkit()
search_toolkit.search_mcp_servers(
    query="Slack",
    package_registry="npm",  # Only search for servers registered in npm
    top_k=1,
)
{
  "name": "Slack",
  "url": "https://www.pulsemcp.com/servers/slack",
  "external_url": null,
  "short_description": "Send messages, manage channels, and access workspace history.",
  "source_code_url": "https://github.com/modelcontextprotocol/servers/tree/HEAD/src/slack",
  "github_stars": 41847,
  "package_registry": "npm",
  "package_name": "@modelcontextprotocol/server-slack",
  "package_download_count": 188989,
  "EXPERIMENTAL_ai_generated_description": "This Slack MCP Server, developed by the Anthropic team, provides a robust interface for language models to interact with Slack workspaces. It enables AI agents to perform a wide range of Slack-specific tasks including listing channels, posting messages, replying to threads, adding reactions, retrieving channel history, and accessing user information. The implementation distinguishes itself by offering comprehensive Slack API integration, making it ideal for AI-driven workplace communication and automation. By leveraging Slack's Bot User OAuth Tokens, it ensures secure and authorized access to workspace data. This tool is particularly powerful for AI assistants designed to enhance team collaboration, automate routine communication tasks, and provide intelligent insights from Slack conversations."
}

MCP Search Agents (PR 2222)

from camel.agents import MCPAgent, MCPRegistryConfig, MCPRegistryType 
smithery_config = MCPRegistryConfig(
  type=MCPRegistryType.SMITHERY, 
  api_key=os.getenv("SMITHERY_API_KEY")
)

# Create MCPAgent with registry configurations
agent = MCPAgent(
  model=model,
  registry_configs=[smithery_config]
)

async with agent:
    response = await agent.astep(message)
    print(f"\nResponse from {message}:")
    print(response.msgs[0].content)

Example 2 (Search + Execution)

  • May require configuration on the MCP registry, in this case, Smithery.
  • message = “Use Brave MCP search tools to find information about Camel-AI.org.”
"""
Response from Use Brave MCP search tools to search info about Camel-AI.org.:
 # CAMEL-AI.org: Information and Purpose
 Based on my search results, here's what I found about CAMEL-AI.org:
 ## Organization Overview
 CAMEL-AI.org is the first LLM (Large Language Model) multi-agent framework and 
 an open-source community. The name CAMEL stands for "Communicative Agents for 
 Mind Exploration of Large Language Model Society."
 ## Core Purpose
 The organization is dedicated to "Finding the Scaling Law of Agents" - this 
 appears to be their primary research mission, focusing on understanding how 
 agent-based AI systems scale and develop.
 ## Research Focus
 CAMEL-AI is a research-driven organization that explores:
 - Scalable techniques for autonomous cooperation among communicative agents
 - Multi-agent frameworks for AI systems
 - Data generation for AI training
 - AI society simulations
 ## Community and Collaboration
 - They maintain an active open-source community
 - They invite contributors and collaborators through platforms like Slack and 
 Discord
 - The organization has a research collaboration questionnaire for those 
 interested in building or researching environments for LLM-based agents
 ## Technical Resources
 - Their code is available on GitHub (github.com/camel-ai) with 18 repositories
 - They provide documentation for developers and researchers at 
 docs.camel-ai.org
 - They offer tools and cookbooks for working with their agent framework
 ## Website and Online Presence
 - Main website: https://www.camel-ai.org/
 - GitHub: https://github.com/camel-ai
 - Documentation: https://docs.camel-ai.org/
 The organization appears to be at the forefront of research on multi-agent AI 
 systems, focusing on how these systems can cooperate autonomously and scale 
 effectively.
"""

Agent as MCP (PR 2144)

Define and Export Your Own Camel Agents!

# Create a default chat agent - customize as needed
chat_agent = ChatAgent()
chat_agent_description = "A general-purpose assistant that can answer questions and help with various tasks."

reasoning_agent = ChatAgent(
    model=ModelFactory.create(
        model_platform=ModelPlatformType.OPENAI,
        model_type="gpt-4o-mini",
    )
)
reasoning_agent_description = "A specialized assistant focused on logical reasoning and problem-solving."

# Create another agent for searching the web
search_agent = ChatAgent(
    model=ModelFactory.create(
        model_platform=ModelPlatformType.OPENAI,
        model_type="gpt-4o",
    ),
    tools=[FunctionTool(SearchToolkit().search_brave)],
)
search_agent_description = "A research assistant capable of retrieving information from the web."

# Provide a list of agents with names
agents_dict = {
    "general": chat_agent,
    "search": search_agent,
    "reasoning": reasoning_agent,
}

# Provide descriptions for each agent
description_dict = {
    "general": chat_agent_description,
    "search": search_agent_description,
    "reasoning": reasoning_agent_description,
}

Agent as MCP Example - Using Claude Desktop

  • Provide proper configs to Claude:
"camel-chat-agent": {
  "command": "/Users/jinx0a/micromamba/bin/python",
  "args": [
    "/Users/jinx0a/Repo/camel/services/agent_mcp_server.py"
  ],
  "env": {
    "OPENAI_API_KEY": "...",
    "OPENROUTER_API_KEY": "...",
    "BRAVE_API_KEY": "..."
  }
}
  • Now let’s use Claude to interact with Camel agents!

Ongoing MCP Developments

  • MCP Search Agents: Integration with additional MCP registries including Composio
  • MCP Hub: Hosting and validating our own repository of MCP servers
  • Role-Playing/Workforce as MCP Servers: Transforming Camel’s multi-agent module into MCP servers

Thank You!